<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Graphics Contexts</title>
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="GTK+ 2 Reference Manual">
<link rel="up" href="gtkbase.html" title="Part II. GTK+ Core Reference">
<link rel="prev" href="gtk-Standard-Enumerations.html" title="Standard Enumerations">
<link rel="next" href="GtkStyle.html" title="Styles">
<meta name="generator" content="GTK-Doc V1.18 (XML mode)">
<link rel="stylesheet" href="style.css" type="text/css">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF">
<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="2">
<tr valign="middle">
<td><a accesskey="p" href="gtk-Standard-Enumerations.html"><img src="left.png" width="24" height="24" border="0" alt="Prev"></a></td>
<td><a accesskey="u" href="gtkbase.html"><img src="up.png" width="24" height="24" border="0" alt="Up"></a></td>
<td><a accesskey="h" href="index.html"><img src="home.png" width="24" height="24" border="0" alt="Home"></a></td>
<th width="100%" align="center">GTK+ 2 Reference Manual</th>
<td><a accesskey="n" href="GtkStyle.html"><img src="right.png" width="24" height="24" border="0" alt="Next"></a></td>
</tr>
<tr><td colspan="5" class="shortcuts">
<a href="#gtk-Graphics-Contexts.synopsis" class="shortcut">Top</a>
                   | 
                  <a href="#gtk-Graphics-Contexts.description" class="shortcut">Description</a>
</td></tr>
</table>
<div class="refentry">
<a name="gtk-Graphics-Contexts"></a><div class="titlepage"></div>
<div class="refnamediv"><table width="100%"><tr>
<td valign="top">
<h2><span class="refentrytitle"><a name="gtk-Graphics-Contexts.top_of_page"></a>Graphics Contexts</span></h2>
<p>Graphics Contexts — A shared pool of GdkGC objects</p>
</td>
<td valign="top" align="right"></td>
</tr></table></div>
<div class="refsynopsisdiv">
<a name="gtk-Graphics-Contexts.synopsis"></a><h2>Synopsis</h2>
<pre class="synopsis">
#include &lt;gtk/gtk.h&gt;

<a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="returnvalue">GdkGC</span></a> *             <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-get" title="gtk_gc_get ()">gtk_gc_get</a>                          (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> depth</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a> *colormap</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Graphics-Contexts.html#GdkGCValues"><span class="type">GdkGCValues</span></a> *values</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Graphics-Contexts.html#GdkGCValuesMask"><span class="type">GdkGCValuesMask</span></a> values_mask</code></em>);
<span class="returnvalue">void</span>                <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-release" title="gtk_gc_release ()">gtk_gc_release</a>                      (<em class="parameter"><code><a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>);
</pre>
</div>
<div class="refsect1">
<a name="gtk-Graphics-Contexts.description"></a><h2>Description</h2>
<p>
These functions provide access to a shared pool of <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> objects.
When a new <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> is needed, <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-get" title="gtk_gc_get ()"><code class="function">gtk_gc_get()</code></a> is called with the required depth,
colormap and <a href="../gdk/gdk-Graphics-Contexts.html#GdkGCValues"><span class="type">GdkGCValues</span></a>. If a <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> with the required properties already
exists then that is returned. If not, a new <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> is created.
When the <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> is no longer needed, <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-release" title="gtk_gc_release ()"><code class="function">gtk_gc_release()</code></a> should be called.
</p>
</div>
<div class="refsect1">
<a name="gtk-Graphics-Contexts.details"></a><h2>Details</h2>
<div class="refsect2">
<a name="gtk-gc-get"></a><h3>gtk_gc_get ()</h3>
<pre class="programlisting"><a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="returnvalue">GdkGC</span></a> *             gtk_gc_get                          (<em class="parameter"><code><a href="http://library.gnome.org/devel/glib/unstable/glib-Basic-Types.html#gint"><span class="type">gint</span></a> depth</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a> *colormap</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Graphics-Contexts.html#GdkGCValues"><span class="type">GdkGCValues</span></a> *values</code></em>,
                                                         <em class="parameter"><code><a href="../gdk/gdk-Graphics-Contexts.html#GdkGCValuesMask"><span class="type">GdkGCValuesMask</span></a> values_mask</code></em>);</pre>
<p>
Gets a <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> with the given depth, colormap and <a href="../gdk/gdk-Graphics-Contexts.html#GdkGCValues"><span class="type">GdkGCValues</span></a>.
If a <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> with the given properties already exists then it is returned,
otherwise a new <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> is created.
The returned <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> should be released with <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-release" title="gtk_gc_release ()"><code class="function">gtk_gc_release()</code></a> when it is no
longer needed.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody>
<tr>
<td><p><span class="term"><em class="parameter"><code>depth</code></em> :</span></p></td>
<td>the depth of the <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> to create.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>colormap</code></em> :</span></p></td>
<td>the <a href="../gdk/gdk-Colormaps-and-Colors.html#GdkColormap"><span class="type">GdkColormap</span></a> (FIXME: I don't know why this is needed).</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>values</code></em> :</span></p></td>
<td>a <a href="../gdk/gdk-Graphics-Contexts.html#GdkGCValues"><span class="type">GdkGCValues</span></a> struct containing settings for the <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a>.</td>
</tr>
<tr>
<td><p><span class="term"><em class="parameter"><code>values_mask</code></em> :</span></p></td>
<td>a set of flags indicating which of the fields in <em class="parameter"><code>values</code></em> has
been set.</td>
</tr>
<tr>
<td><p><span class="term"><span class="emphasis"><em>Returns</em></span> :</span></p></td>
<td>a <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a>.</td>
</tr>
</tbody>
</table></div>
</div>
<hr>
<div class="refsect2">
<a name="gtk-gc-release"></a><h3>gtk_gc_release ()</h3>
<pre class="programlisting"><span class="returnvalue">void</span>                gtk_gc_release                      (<em class="parameter"><code><a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> *gc</code></em>);</pre>
<p>
Releases a <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a> allocated using <a class="link" href="gtk-Graphics-Contexts.html#gtk-gc-get" title="gtk_gc_get ()"><code class="function">gtk_gc_get()</code></a>.
</p>
<div class="variablelist"><table border="0">
<col align="left" valign="top">
<tbody><tr>
<td><p><span class="term"><em class="parameter"><code>gc</code></em> :</span></p></td>
<td>a <a href="../gdk/gdk-Graphics-Contexts.html#GdkGC"><span class="type">GdkGC</span></a>.</td>
</tr></tbody>
</table></div>
</div>
</div>
</div>
<div class="footer">
<hr>
          Generated by GTK-Doc V1.18</div>
</body>
</html>